fix random string generation problem