Add semaphore into controller for atomic actions