Added ajax security (check_ajax_referrer)