hacky exception handling