moved loading to main load function