Changed pinning back to using a semaphore, don't think it broke