switched to $.ajax instead of $http