Fixed bug with priority