fixed unit-scope lookup and added static symbol logic