Fixed scope bug