Used $timeout to have directive autostart when DOM is ready