JS now works properly on the homepage