fixing random string generation code