ajax race condition should be handled