make defer and blocking work nicely together