added backup code in discrete file