fixed a bug where jquery would return undefined is not a function