make it work properly with python 3