Attempt to fix scope issues