added additional thread-safety