Added checks for input fields.