This is a RCT study with 2 groups (intervention and control) that the intervention group receives magnesium hydroxide before operation and the control group receives mgso4 after induction of anesthesia. The sample size is at least 36 in each group that it is increased to 43 considering loss to follow up rate of 20%. The goals are: studying the effects of oral magnesium in prevention of arrhythmia and decreasing in hypomagnesaemia rate after CABG, studying intravenous magnesium effects in prevent of arrhythmia and hypomagnesaemia after CABG. The patient who is candidate for CABG enters the study. If one of them has the history of arrhythmia that did not treat, having the history of renal failure or liver dysfunction, patients who have re-operation after main operation, patients who have received b-blocker or ca–blocker before operation because of arrhythmia and patients who are treated with magnesium before operation are excluded from study. The interventions which were done in this study include: taking blood sample for serum magnesium examination and taking electrocardiogram before operation, giving oral magnesium supplement (MOM) to the intervention group before operation and intravenous magnesium (mgso4) to the control group, taking serum magnesium sample during rewarming when the patient is under CPB, checking EKG monitoring for finding existence of arrhythmia before ,during and after CPB , taking serum magnesium sample at the entrance to the intensive unit care (ICU) and repeat it 6,12,24 and 48 hours after this ,taking EKG the entrance time ,24 and 48 hours after it and checking them for presence f arrhythmia.