Fixed AJAX error with modern browsers