better error handling in grids