fix premature shutdown