fix a bug, still not right in 3D