Added validation to input