fixed annoying scope bug