fix d and r