fixing file pointer