Simulation of MHD instabilities with fluid runaway electron model in M3D-C1