trying to figure out thread safety