fix the exception handling in __init__