add assertion in tagToString