update loading logic
update loading logic