fixing readBlock and writeBlock for LevelDB