improve loading logic. it almost does something sensible now