Added semaphore to prevent too many simultaneous http requests.