fix stack counter