preparetablevalue function amended for missing slashes