fix stackoverflow on touch device