change comment function to using foreign key