Fixing a bug: onRegistered and onUnregistered are executed off the main
thread. Removing async calls.