exposed $state to view