Fixing pathing on middleware