fixed raytrace bug