Add exception for execute cmd when shell is closed