Added validation and clear input