replaced exceptions with undefined