better catching exceptions