Adding retry funcitonality.