Added error handler for iPad debugging