StateClosing (implementation quite ugly)