fix a bug in Valid Palindrome solution