modified legacy user creation function