For issue#16
For issue#16: Adding error messages and cleaning the registeration process