Fix delete version function