fixed bug: now end_callback would be called if the resources are loaded before.