registering improved. added javascript to chat