add middleware test