Please, check for this condition. I am not sure, that it is enough to run those functions just in activitypage.php?mode=notify.