move check_R to on_modified