add logic before str6