udpates to user middleware
fix merge conflicts