Fix update function and add click event

TODO: fix coordinate of posX