fixing fields to use the model primary key
fixing controller argument in beforeRender