fixed bug in read_cat()