add classes on invalid input