Changed code that detects jqueries presence, this seems to work