using action hook instead of this plugin