keep track of the latest timestamp retrieved and only look for newer messages when querying the db