fixed a class, that was written for python2