fixed magic write