fixed shutdown issue