fixed all the loading bugs