Fix Scheduler Bug

- Deque operation of scheduler queue returns the pointer of its own. ->
queue operation check its status so ensure it’s not empty.
- result of dequeue operation should be null-checked