changes to loading logic