added MBThreadFlag cleanup