fixed retry mechinisim to allow specific retry count