fix device_filter logic