verify hashtags array is not empty before iterating