implement Search for messages