added some pause code