Added mysterious bug in destructor of apc class