fixing the prority queue