changed ajax request to sync