fixed fatal error detection