added tries counter (default 3 tries)