More robust newuser script