Added catch for IllegalArgumentException.