corrected error in rpy function