fix a bug of ray tracing