updated code in read table