Solve different scope issues; fix