Bug fixed for registration