fixed minor bug on viewer close.
fixed minor regression.