made protocol change more thread safe