Better error handling and popup view support