fix a bug in span case