check file existence before loading