random string and error fixing