Implemented self logic for static middleware