insert into controller instead of middleware