add semaphore
started batch support