add end for free and close file, option file ok and error message done