Added condition to prevent deferred to be created several times when calling several times 'ready' method