Fix Exception catching

Fix Exception catching