fix code related to viewer