better latest filtering (querying the db instead)