fixed the empty document bug
fixed the xss vulnerability in chat room