Terminating background processes