fixed repeating scope bug