fix bug in random-string function