Fixed bug when only one link could be in db and no link appears twice