work on dosave logic