Added destroy method for cleanup during the closing