Added threading support to the plugin. Many thanks to user Aragas for help with this code.