write robust std errors