added switch to work with python2