Changed the adding of priority.