changed checking len(tag_object) to len(tag_objec.as_list())