change r to w