fixed incorrectly retrieved data from dictionary in unique_freq