fixing some bugs with priority of pools