changed handling of exceptions for logical errors