fix ray trace