added global error handler to try and catch a weird issue that only happens on certain devices