Prevent null state id
prevent null state id