Added priority handling