thread safety++ (maybe some stuff broke...)