Adding onError param to load method, and fixing double call to callback function on register