fixed bug related to points code when no data in table