Added duo middle-ware support