Fix grid #undefined error