Fixed bug to register