bug fixes with mad