Adding thread safe to yaml