so i'm wondering if is worthy to define a global middleware