fixing scope warnings