Add function repeat_until_success. Use it for setting passwords