add defer/recover for testing=