fix scope derived bug