Forgot to reset loop counter