moved chat js to its own file