onAuthorized and onUnauthorized added