added a separate semaphore for network
remove semaphore