added functional retry option