change the way saving works to fix #35