handling nested phrases