make sure to remove a viewer in all appropriate cases
Merge pull request #9 from hayksaakian/master

make sure to remove a viewer in all appropriate cases