fixed a VERY crucial error in table reading and processing