added pause detection