fixed snprintf problem