fixed error on saving file