fixed problems regarding python 3 compatibility