Fix bug for stack level error