Added local state to object so it could be used as a sub-component.