implement a dealloc method