Add nested scope support