added viewer support and bug fixes