Updated JS with AJAX call