added config file and some error checking in the plugin not near finished yet