Need "inStack[w]=false;" after line 65

Need "inStack[w]=false;" after line 65, or there exist a bug that will output error results