fix loading bugs