Added indentity test on client and improved validation