fix dispatch_semaphore_wait not nil bug