Added input field validation