fix #32, empty string checking should be after span built