check args for replace_first