fixed a random jquery vs javascript bug: