check if file exists instead of just reading