Added shift method to avoid duplication of tags in search string