I think you dont have table packed after deleting record, you only have to do is use this command at the begining of your program:
SET DELETED ON
** it will hide all deleted records
then issue the PACK command when you exit the program to properly remove all deleted records.....