Working to enable javascript to load correctly on both single and double page views