added inactivity tracking and fixed a few viewer bugs