Added sql printing middleware