Fix loading logic

@fyruicao pls review thx!