bug fix for Rscript