added angular.toJson before sending complex object data via sockets