improve grid error handling