need to return grid object in gridplot function