add context and static middleware