bug fixed: duplicate rows in table