changed so that it can save