fix possible PROTECT problem in do_if