repair and add gui functionality