restore saveing
add gpg support