adjust sort proc for restriction