add a connected variable to make state clearer