testing middleware