change & restore cpoptions