hack to work on both versions of python