check the  file whether exists before reading file