implemented retry feature