fix call stack overflow