Fixed a test and refactored updatePriorityForTask
Reset on route change