Fixed database tables columns duplication when switching tables