fix the bag in is_palindrome