fix delete functions