fixing scope stuff