fix MR bugs