fix a crash on restore in android