Appear to have fixed threading bug