Handle exceptions in loading