bugfix for viewer.