Avoid using inline javascript to update message list