error logging improvements