check if file exists before using it