catch exception when running on iOS sim
politely resign first responder when necessary