fix: Bug in SetPriority function

* The function haven't actually considered the priority which was to be
  set in case the tasks priority was from A-Z