fix all the remaining ajax bugs