If it's a duplicate, then why not just make line 71 this middleware and call it a day?