fix ordering, get shutdown working