Added try/catch statement for invalidParameterExceptions.