fixed the scope variable