implemented pausing on pause of app