improve error spans