Validation for invalid entries and error message