update stack counter