Maintaining the reliability of a system is one of the most critical and challenging tasks for manufacturing system during production. In this paper, we suggest to use condition based maintenance (CBM) in order to reduce unavailability of machines. CBM is a kind of preventive maintenance (PM), based on condition monitoring. This paper focuses on solving the flexible job shop scheduling problem with preventive maintenance (FJSPPM), adding PM into FJSP. Application of CBM makes the scheduling problem dynamic, as the moment of carrying on maintenance is not deterministic. In order to solve this dynamic FJSPPM (DFJSPPM), firstly, we apply an integrated genetic algorithm (IGA) for FJSP, and then, we use an inserting algorithm (IA) to add PM into solutions of FJSP found by (IGA). To demonstrate efficiency of IA for treating maintenance scheduling, we compare it with our simultaneous scheduling algorithm (SSA) and with neighborhood search called hGA in numerical examples of literature. A new better solution for an instance in benchmark of FJSP is obtained with our approach.