Hacky exception handling