trying to fix bug when no records