set priority based on last task (commented out)