Check whether file exists before reading