r command bug fix