fix a bug of r command