fixes for defined primary key