Using promise for registration