connect write with UI element
write works by clicking in UI