added length validation to registration