add debug for errors messages