Fix bug in the displaying the correct longest palindrome

Fix bug in the displaying the correct longest palindrome