FIXED ugly JS hack for projects with current jQuery versions