improved handling of invalid saved state