file io bug fixed