fix scope problem