fix scope lookup