ajax working until middle but not back