add dirty logging when an error occured