updated to allow saving