Error with sorting priority resolved