added the fuction to the 'plugins_loaded' action hook