update the password only if it is required