New messages search function