fix return scope bug