solve a bug in viewer