fix bug where callback is not invoked when load fails.