test if file exists before