R error fixed