adding session permission and cleaning up views