added python2 compatibility for those outdated