change dropdown list when clicking tags
handle extra spaces