fix bugs introduced with AJAX load system