fix bug of running middle job on agent