ajax curl working till middle but not back