Update sectionController.js

fix race condition on prevSection.ended dispatch.