Moved variable outside of scope