fixed R file problems