Fixed a crash, looks at more state information