bugfix thread-safety