fix span parsing