stops throwing errors when javascript loads on wrong page

type checks in document.ready. There must be a better way to do this.
removes class taken on DOM reset