fix job grabbing in case of race