A higher order numerical scheme for generalized fractional diffusion equations