improve touch logic