Fix AJAX data not being sent correctly