wait for application to start/stop