implement release() and deallocate() of resources