Fixed JS for login filter so it works regardless of which page you're on