update 'getVarAsStr' function