State machine improvement

Added a null state just in case any weirdness happens