corrected algo to create user objects