added support for jquery compatibility mode