fixed deleting of contracts