update connect module and fix csrf middleware