created a handler for input text