right order of ajax request confirmation