store the last variable only if it exists