added proper way to manage loading the plugin
fixed alot of stuff