clear element on data update if data.length is 0