modified mb_free