Updated for thread fix