Fixed null state bug