jQuery deferred error - Fixes issue #1