Fix bug which is not able to get registrationId for the first time only