added a class to process input if valid