set retry times limit for error handling