refs #1816 do not pass variable by reference, leads to weird issues