fixed errors that arise when using python3.x