Move it into middleware? Maybe it'll help?