Fixed a typo in the isValidPriority() function