added javascript to start states with receivers