fix some bugs for when there was no tracks in db