set correct r