fix bug with deleting newly added record