only call loadfile if file exists