added logic to view
Merge pull request #1 from Hkly/view_fix

added logic to view