Small change to avoid printing the error message twice