fixed bug with wrong entries being deleted