fixed bug in readTable