fixed tail of empty string bug