make unpretty even more re-entrant safe