Fix grid association query