added nested aggregate