added encode function in  whiteboardmodel