Added deinit function