added retry and reset functionality.