fixed premature shutdown error