Correcting indexing for messages