added restore state capability to widgets