fix bug with not deleting dictionary entry