Make volatile

HasStateChanged will be accessed from multiple threads and therefore must be made volatile.