Use $timeout

Use $timeout to prevent $digest errors