catch custom exception instead of generic exception