move setting of workspace to before save