Fixed endEvent issue on touch devices