fixed ajax bugs from merging