save mode & state