update the code to fix bug of removing _r.m and _s.m