add subscribing middleware