Added missing $timeout in directive