fix snprintf issue