added validate code and remvoved vm_chatlib.js