fixes game crash on empty stack click and not deselecting on right click