fix coil writing for test purposes