use variable from params and also validate the purge_preferences_d