Fixing bug with whenDone and pushState in Ajax.