use snprint instead of sprint