added autosave function

Signed-off-by: dan-hoerr <dhoerr@gmail.com>