checked if database empty before update viewer