added retry handling