Make threadsafe to enable models to be available to rake tasks