dev: add

Neglected to fix the try statement on the previous version. This code
has been tested and it seems to work on both python 2 and 3.