bug in finalization