fix scope issue