fixing scope failure