bugfix: proper deallocation!