trying to sort broken ajax