tweak retry code