fix settings save error and added cache expiration