Addition of some basic thread safety