Added functinality to spawner.js