added do_merge option