more fixes
some changse to try and fix the shutdown issue