added pause/unpause functionality