fixed error when no groups are returned