setTimeout should not be used inside angular ... use $timeout instead