fixed a bug of bining rays