Add exception handling and contextlost re-loading