add mon ref and clean warning unused var