fixed null state bug