fixed db primary key problems