New function setWorkspace