removing hard coded bit by using $http