fixed to work with python3