added Semaphore control fpr serial device