write control of behavior when users click on suggested word or press enter