Replace timeline.defer by $timeout