fix for rare threading bug?