Added lock for AJAX

Added lock for AJAX - going to add more!