[fix] scope to middleware