fixed run R Script function