fix touch handling bugs