use ajax to set async = false