Fix to the too many pending jobs problem