added semaphores to prevent parallel refreshes