fix js bugs
server validation