copied from oc 2.0.8