Move the semaphore so that it only gets used when app is in the background