support middleware in all handlers