Add state and scope handler