fixing snprintf