update messages index js