fixed 3d bugs