more error logging improvements