Changed data to use the values from AJAX request