Add print middleware