update the filehandle class and pass the test cases from 1 to 7 except 2