corrected method of randomFile generation

accidentally changed randomFile creation code.