added dealing with gtables