Fix out of scope problem