added code to distinct click and mouseup