Added validation to registration