Fixed javascript in chat