add in support for exceptions, fix #27