Add in better exception handling