try to support older ipython versions
cleanup