The set user function got lost during refactoring. Adding it back.