replaced key listener with action listener for text field