This middleware can be removed if you make the change to the makeclient above