loading of saved state implemented