add founction using AJAX