Used canvas.onmousedown instead of addeventlistener