write works but not in a good way