nested hooks fix