some python2 compatibility
works with python 2.7