change exit completion mechanism to semaphore

Use semaphore is more simpler than completion