fix single matches and multi matches of raplaces