Wrong Answer in next smallest palindrome problem(PALIN)

I applied this approach in next smallest palindrome PALIN

my Solution QUSKZe - Online C++0x Compiler & Debugging Tool - Ideone.com

Please help me where i am wrong.

Thank You