tried to make logging even more robust... sigh...