added registration and validation to registration