Added default value for err variable.