Added register funtionality