Fixed saving new user ref to repository