Fix callbacks and make loading process synchronous