added pause code