Added support for pickling