solving mistakes in scope