fixed initial loading bug