fixed snprintf