surround stringify hack with try/catch and default typeof output value