state preservation code added