check for nil state when recursing