fixes ray generatio