Change code to use hashPassword