make sure that pending commands have been processed