[#1000] the previous commit was stupid because it ignored the fact that ajax request is asynchronous.