fix creation of ajax request