fix bug for stack level