Use MVar to prevent Chan leaking