Renamed a variable, made AJAX request blocking to try and fix a race condition