Update SwarmController.js

An updated to the swarm controller was given and the issue was resolved, missing keywords where found to be the problem "function"