fixed issue with grid allocation