fixes issue #36: error on deleting old sessions
fixes issue #41: fixed restore