solve a bug in viewer(again)