function SetLocal now working