added pause and retry functionality