bug fix and viewer enhancement