Fix click outside canvas bug