fixed crash when objects are out of grid