fixed ray bug