add searchForMessages method