Added JavaScript to prevent sending another AJAX request if previous one hasnt completed