Added touch events and fixed a little bug