Fix for existing semaphore problem