Making the plugin threadsafe (Issue #8)