Adding catch for invalid exception