fix wrong memory management in o_class