get attributes, remove tag array key if not exist