Incorrect scope for this(refactoring problem)