implement isValidPriority