Added synchronous method to AJAX