updated lf script. added error messages