I believe this needs to move above the call to `xhr()`