fix bug of displaying wrong category when select a different dataset