trying to fix shutdown problem