fixed tricky release of objects