Fixing main page JS