Made it exit on no tasks left