the method to dismiss the keyboard after users hit return is implemented