removing unused variables
correcting missing scope item