Fixed the raycasting