trying to fix nvm loop error