static getPrimaryKey bug fix