Make sure the state is passed in to the toggleClass attribute function.