Fixing the jQuery loaded check to make it more robust.