Change this one to `rev.previous` ? Also, need to make sure that it doens't call the db twice here and then again below.