trying to solve the scope problem