fixes the issues with both main and magazine.js