fixed some loading bugs