add in support for exceptions, fixes #1