defer all actions as long as possible to avoid race conditions