fixed tag filtering
start locking *before* resolving entities