fixed bug when arch>1.3 raycasting grid fails