Updated so both printing an error message and checking for palindrome are
ok