adding filter function for clear_cache and clear_data