checks if file exists before reading now