added temporary grid solution (grid was nullpointer)