fixed wrong returned value when called in list context, added more parameters passed to retry and on failure code