legacy python 2.7 bug fixed