use snprintf instead of sprintf, it is safe though