#1016 - fixing state bug