Changed Exception syntax to python 3