Fixing placement of where we clear out the callback functions so that it
only happens after we reach readyState 4