fix gesture generator logic