adding semaphore functionality