make data access in the threads a bit more safe (note: probably will need some more safety measures later on)