change the password generate function