adjusted save variable (fixed multiple definition error