Batch now working, write is broken