fixed an undefined variable exception in the automation script
improved the automatic adding of appfilter rules if the previous file had them set