added code for priority processing