fixed some disk write and read errors