scope bug fix