Fixed Javascript decoupling issues between the homepage and application wide functions