fix the R related problem