fix error when no logs in db