A construction machine comprising; a first and a second variable displacement hydraulic pumps and a pilot pump ; a left travel motor and a first working device that are operated by the first variable displacement hydraulic pump ; a plurality of control valves that are installed in a flow path of the first variable displacement hydraulic pump and control the hydraulic oil supplied to the left travel motor or the first working device; a right travel motor and a second working device that are operated by the second variable displacement hydraulic pump ; a plurality of control valves that are installed in a flow path of the second variable displacement hydraulic pump and control the hydraulic oil supplied to the right travel motor or the second working device; a straight travel valve that is switched by a pilot pressure induced from an electrical control valve , the straight travel valve , when being switched, supplying the hydraulic oil of one of the first and second variable displacement hydraulic pumps to the left and right travel motors while supplying the hydraulic oil of the other of the first and second variable displacement hydraulic pumps to the first and second working devices; and a pressure detection sensor for detecting a pilot pressure applied to the left and right travel motor control valves and the pilot pressure applied to the first and second working device control valves ; characterized in that the construction machine further comprises: a controller that outputs a control signal to the electrical control valve so that the pilot pressure applied to the straight travel valve is blocked in case that a pressure difference between the pilot pressures applied to the left and right travel motor control valves is larger than a pre-set pressure value, when the first and second working devices are operated during a travel. a first and a second variable displacement hydraulic pumps and a pilot pump ; a left travel motor and a first working device that are operated by the first variable displacement hydraulic pump ; a plurality of control valves that are installed in a flow path of the first variable displacement hydraulic pump and control the hydraulic oil supplied to the left travel motor or the first working device; a right travel motor and a second working device that are operated by the second variable displacement hydraulic pump ; a plurality of control valves that are installed in a flow path of the second variable displacement hydraulic pump and control the hydraulic oil supplied to the right travel motor or the second working device; a straight travel valve that is switched by a pilot pressure induced from an electrical control valve , the straight travel valve , when being switched, supplying the hydraulic oil of one of the first and second variable displacement hydraulic pumps to the left and right travel motors while supplying the hydraulic oil of the other of the first and second variable displacement hydraulic pumps to the first and second working devices; and a pressure detection sensor for detecting a pilot pressure applied to the left and right travel motor control valves and the pilot pressure applied to the first and second working device control valves ; <EOS>