fix broken middleware causing `cant set headers after they are sent` Errors upon multi browser refreshes
fix lints