added event to register button