fix a bug in cat