Added code for registration