modified gesture handler