clean starting and stopping of apps