Add '&' before the restoration of cpoptions to make it work