Move hardcode id to primary_key

use primary_key reference instead of id