Added logic for saving a new password