implemented UI restoration