Fixing retry count if max tries exceeded