bug: static queue need to update task's validity while searching for
highest priority task
- add some comments