javascript only loads on show index page