fixed commands using wrong index