Fixing socket calls angularjs