save variable err fixed