move invalid out of scope