updated get searach history to only return distinct