Added pausing logic