set function context of getState to view