A method for on-line determination of residual water content and sublimation end-point during freeze-drying