Another weird threading bug