add fatal error catching