fix for ajax not synchronicity